﻿using System.Windows.Media;

namespace WickedFlame.Core.Extensions
{
    public static class PenExtensions
    {
        public static PenLineJoin ToPenLineJoin(this PenLineCap value)
        {
            var lineJoin = PenLineJoin.Miter;

            switch (value)
            {
                case PenLineCap.Square:
                case PenLineCap.Flat:
                    lineJoin = PenLineJoin.Miter;
                    break;
                case PenLineCap.Round:
                    lineJoin = PenLineJoin.Round;
                    break;
                case PenLineCap.Triangle:
                    lineJoin = PenLineJoin.Bevel;
                    break;
            }

            return lineJoin;
        }
    }
}
